#!/bin/bash
export PATH=$PATH:/opt/trunk/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/
export CROSSCOMPILE=mipsel-openwrt-linux-
# export PATH=$PATH:/projects/toolchain-mips_mips32_gcc-4.8-linaro_uClibc-0.9.33.2/bin
# export CROSSCOMPILE=mips-openwrt-linux-
export ENV_LDFLAGS=/opt/trunk/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libatomic.a
export CFLAGS="-g -DTV_PROJECT"
export HOST=mips
export DEVNAME=hiwifi
export HTTPS_SUPPORT=1
export USE_WOLFSSL=1
export EXEC_probe=tvProbe
export EXEC_loader=tvLoader
export EXEC_monitor=tvMonitor


if [ "$1" = "release" ]; then
	make && make release
else
	make && make tar
fi
make clean -C test && make -C test
